//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.zqj.project.common.exception;

import com.zqj.project.common.exception.code.ExceptionCode;

import java.io.Serial;

/**
 * @Description: UnauthorizedException
 * @Author: 22001010704 Zhang Qijian
 * @CreateTime: 2024/6/17 21:06
 * @Version: 1.0
 */
public class UnauthorizedException extends BaseUncheckedException {

    @Serial
    private static final long serialVersionUID = 1L;

    public UnauthorizedException(int code, String message) {
        super(code, message);
    }

    public static UnauthorizedException wrap(String msg) {
        return new UnauthorizedException(ExceptionCode.FORBIDDEN.getCode(), msg);
    }

    @Override
    public String toString() {
        return "UnauthorizedException [message=" + this.getMessage() + ", code=" + this.getCode() + "]";
    }

}